package main

import "github.com/Shopify/sarama"

type KafkaCfg struct {
	Producer struct {
		Topic   string
		Brokers string
	}
	Consumer struct {
		Topics     string `xml:"Topics"`
		Brokers    string `xml:"Brokers"`
		GroupID    string `xml:"GroupID"`
		InitOffset string `xml:"InitOffset"` //初始化offset起始位置 Newest Oldest
	}
}

type SASLCfg struct {
	UserName string
	PassWord string
}

type FuncDataCallback func(msg *sarama.ConsumerMessage)    //消费数据回调
type FuncSuccessCallback func(msg *sarama.ProducerMessage) //生产成功数据回调
type FuncErrorCallback func(msg *sarama.ProducerError)     //生产失败数据回调
type FuncEventCallback func(info string, eventType string) //事件回调
